package sorter;

import java.io.Serializable;
import java.util.Random;

public class Movie implements Comparable, Serializable {

	private String title;
	private String director;
	private int jaarUitgekomen;
	
	public Movie(String title, String director, int jaarUitgekomen){
		this.title = title;
		this.director = director;
		this.jaarUitgekomen = jaarUitgekomen;
	}
	
	@Override
	public String toString() {
		return "Movie [title=" + title + ", director=" + director
				+ ", jaarUitgekomen=" + jaarUitgekomen + "]";
	}

	@Override
	public int compareTo(Object obj) {
		if (obj instanceof Movie){
			Movie film = (Movie) obj;
			return this.title.compareTo(film.title);
		}
		return -1;
	}
	


	
}
